﻿#include "addclientdialog.h"
#include "ui_addclientdialog.h"

#include <QMessageBox>

AddClientDialog::AddClientDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AddClientDialog)
{
    ui->setupUi(this);
}

AddClientDialog::~AddClientDialog()
{
    delete ui;
}

QString AddClientDialog::getInputIp(void)
{
    return ui->lineEdit->text();
}

QString AddClientDialog::getInputPort(void)
{
    return ui->lineEdit_2->text();
}

QString AddClientDialog::getInputDebugPort(void)
{
    return ui->lineEdit_3->text();
}

void AddClientDialog::on_pushButton_clicked()
{
    if(ui->lineEdit->text().isEmpty())
    {
        QMessageBox::warning(this,QString::fromLocal8Bit("警告"),QString::fromLocal8Bit("ip不能为空!"));
        ui->lineEdit->setFocus();
        return;
    }

    if(ui->lineEdit_2->text().isEmpty())
    {
        QMessageBox::warning(this,QString::fromLocal8Bit("警告"),QString::fromLocal8Bit("port不能为空!"));
        ui->lineEdit_2->setFocus();
        return;
    }

    if(ui->lineEdit_3->text().isEmpty())
    {
        QMessageBox::warning(this,QString::fromLocal8Bit("警告"),QString::fromLocal8Bit("调试port不能为空!"));
        ui->lineEdit_3->setFocus();
        return;
    }

    done(1);
}
